<template>
    <div>数字：{{ number }}</div>
    <button @click="addNumber">+1</button>
</template>

<script>
import { ref } from 'vue'
export default {
    setup() { 
        let number = ref(1)
        const addNumber = () => {
            number.value++
        }
        return {
            number,addNumber
        }
    }    
}
</script>

